#ifndef CVECTOR2D_H_
#define CVECTOR2D_H_

#include "cvectorbase.h"
#include "../exception/cinvalidsizeexception.h"

/**
 * CVector2D - class representing 2-dimensional vector
 * @author Michal Rost
 * @date 23.07.2007
 */
template <typename T>
class CVector2D : public CVectorBase<T> {
public:
  CVector2D();
  CVector2D(T x, T y);
  CVector2D(const CVector2D<T> &v);
  CVector2D(const CVectorBase<T> &v);
  ~CVector2D();
  CVector2D<T>& operator = (const CVector2D<T> &v);
  CVector2D<T> operator + (const CVector2D<T> &v) const;
  CVector2D<T> operator - (const CVector2D<T> &v) const;
  CVector2D<T> operator * (T num) const;
  CVector2D<T> operator / (T num) const;
  TIndex getSize() const;
  T getX() const;
  T getY() const;
  void setX(T x);
  void setY(T y);
  static string getClassName() {
    return "CVector2D";
  }
protected:
  void setSize(TIndex size);
};

#endif
